<p><%= link_to 'New Album', new_photoalbum_path %> </p>
<div class="album-heading">Your Albums</div>
<div class="albums-box">
<% @photoalbums.each do |photoalbum| %>
  <div class="album-box">
    <div class="album-title"><%= photoalbum.name %></div>
    <%= link_to image_tag("/view.jpeg", :width=>16,:height=>16), photoalbum %>
    <%= link_to image_tag("/edit.jpeg", :width=>16,:height=>16), edit_photoalbum_path(photoalbum) %>
    <%= link_to image_tag("/delete.jpeg", :width=>16,:height=>16), photoalbum, confirm: 'Do you want to delete this album and all the photos?', method: :delete %><br />
    <%=last_image_thumb photoalbum.photos.last%>
  </div>
<% end %>
</div>

